﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/_layouts/application.master"
    Inherits="FieldUpdater.SharePointRoot.Template.Layouts.ManageFieldAssociations, FieldUpdater, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9c94a454f69ba3bb" %>

<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Import Namespace="FieldUpdater.Classes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    <SharePoint:EncodedLiteral ID="EncodedLiteral1" runat="server" Text="Manage Field Associations"
        EncodeMethod='HtmlEncode' />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderPageDescriptionRowAttr"
    runat="server">
    style="display:none;"
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderPageDescriptionRowAttr2"
    runat="server">
    style="display:none;"
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
    runat="server">
    <SharePoint:FormattedString ID="FormattedString1" FormatText="Manage Field Associations"
        EncodeMethod="HtmlEncodeAllowSimpleTextFormatting" runat="server">
        <asp:HyperLink ID="aListEditTitleLink" runat="server" Visible="true" />
    </SharePoint:FormattedString>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="PlaceHolderPageImage" runat="server">
    <img src="/_layouts/images/blank.gif" width="1" height="1" alt="">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="PlaceHolderPageDescription" runat="server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <asp:HiddenField runat="server" ID="hidEditIndex" Value="-1" />
    <script type="text/javascript" src="FAScripts.js"></script>
    <script type="text/javascript">
        var listOfConnectionTypesToShow = "<%= Global.GetFieldAssociatedConnecions() %>";
        var controlToShowClientID = "<%= trConnectionField.ClientID %>";
        var destFieldRowClientID = "<%= trTargetField.ClientID %>";
        var oracleRowDataClientID = "<%= trOracleConnectionSettings.ClientID %>";
    </script>
    <table>
        <tr>
            <td colspan="4">
                <table border="0" cellpadding="0" cellspacing="3">
                    <tr>
                        <td>
                            SharePoint Source Field
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtSource" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Connection Type
                        </td>
                        <td>
                            <asp:DropDownList runat="server" ID="ddlConnectionType" onchange="javascript:ShowHideToDropDownType(this);" />
                        </td>
                    </tr>
                    <tr id="trTargetField" runat="server">
                        <td>
                            SharePoint Target Field
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtDestination" />
                        </td>
                    </tr>
                    <tr id="trConnectionField" runat="server">
                        <td>
                            SharePoint Connection Field
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtConnection" />
                        </td>
                    </tr>
                    <tr id="trOracleConnectionSettings" runat="server" style="display:none">
                        <td colspan="2">
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>
                                        Connection String
                                    </td>
                                    <td>
                                        <asp:TextBox runat="server" ID="txtConnectionString" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Table Name
                                    </td>
                                    <td>
                                        <asp:TextBox runat="server" ID="txtTableName" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        ID or Title Column
                                    </td>
                                    <td>
                                        <asp:TextBox runat="server" ID="txtSourceColumn" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        SharePoint Target Fields
                                    </td>
                                    <td>
                                        <asp:TextBox runat="server" ID="txtTargetColumns" />
                                        <div>* Format: <i>SPField=DBField;SPField2=DBField2</i></div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button Text="Add" runat="server" ID="cmdAdd" CommandName="Add" />
            </td>
            <td>
                <asp:Button Text="Update" runat="server" ID="cmdUpdate" Visible="false" CommandName="Update" />
            </td>
            <td>
                <asp:Button Text="Cancel" runat="server" ID="cmdCancel" Visible="false" />
            </td>
            <td>
                <asp:Button Text="Delete" runat="server" ID="cmdDelete" Visible="false" />
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <asp:GridView ID="gvDefinitions" runat="server" AutoGenerateColumns="false" AutoGenerateEditButton="true">
                    <SelectedRowStyle BackColor="Red" />
                    <EditRowStyle BackColor="Green" />
                    <Columns>
                        <asp:BoundField DataField="ParentFieldName" HeaderText="Parent Field" />
                        <asp:BoundField DataField="ChildFieldName" HeaderText="Child Field" />
                        <asp:BoundField DataField="ConnectionTypeString" HeaderText="Connection Type" />
                        <asp:BoundField DataField="ConnectingFieldName" HeaderText="Connection Field" />
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
    </table>
</asp:Content>
